package com.springcloud.ribbondemo

import com.springcloud.ribbondemo.config.RibbonP1Config
import com.springcloud.ribbondemo.config.RibbonP2Config
import com.springcloud.ribbondemo.config.RootConfig
import org.springframework.boot.SpringApplication
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.cloud.client.discovery.EnableDiscoveryClient
import org.springframework.cloud.netflix.ribbon.RibbonClient
import org.springframework.cloud.netflix.ribbon.RibbonClients
import springfox.documentation.swagger2.annotations.EnableSwagger2

@SpringBootApplication
@EnableDiscoveryClient
@EnableSwagger2

/*
    @RibbonClient:对服务进行个性化配置,最重要的配置是负责均衡策略
        .name:服务名
        .configuration:配置类
                        注意,如果该配置类用于对某个服务提供个性化配置,不要使用@Configuration注解,否则将变成全局配置
 */
//@RibbonClients([ @RibbonClient(name = "p1",configuration = RibbonP1Config.class) , @RibbonClient(name = "p2",configuration = RibbonP2Config.class)])
class RibbonDemoApplication {

    static void main(String[] args) {
        SpringApplication.run RibbonDemoApplication, args
    }
}
